<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    <head>
        <title><?php echo $store_name;?></title>
        <meta charset="UTF-8">
        <meta name="description" content="<?php echo $action['action_name'];?>">
        <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1">
        <link href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
        <script type='text/javascript' src='/public/js/jquery-3.1.1.min.js'></script>
        <script type="text/javascript" src='/public/js/jquery.validate.js'></script>
        <script>
            var _hmt = _hmt || [];
            (function () {
                var hm = document.createElement("script");
                hm.src = "//hm.baidu.com/hm.js?8d43b5b5d798921b66d689f7a792e6e2";
                var s = document.getElementsByTagName("script")[0];
                s.parentNode.insertBefore(hm, s);
            })();
        </script>
        <script type="text/javascript">
            document.domain = '<?php echo _DOMAIN_ALL_;?>';
        </script>
        <link rel="shortcut icon" type="image/ico" href="/favicon.ico">
    </head>
    <body <?php  if(strstr($_SERVER['REQUEST_URI'],'user/passport/') ){ echo 'class="_login_backimg"';} ?> >
 
<link href="/public/css/main.css" rel="stylesheet">
<div class="container" style='font-size:10px;' >
    <div class='_main'>
        <div style='height:1.5rem'></div>
        <div class="<?php if(strstr($_SERVER['REQUEST_URI'],'user/passport/')){ echo '_banner';}else{ echo 'banner';}?>">
            <?php if(!strstr($_SERVER['REQUEST_URI'],'user/passport/')){?>
            <div class='_logo' style='height: 25rem'>
                <a href='#'><img src="/public/images/kaka.png" class='logo_img'  alt='banner' style="width:30%"/></a>
            </div>
            <?php } ?>
            <img src="<?php echo strlen($logo)<1?'/public/images/KAKA-LOGO.png':$logo;?>" class="<?php if(strstr($_SERVER['REQUEST_URI'],'user/passport/')){ echo '_banner_img'; }else{ echo 'banner_img'; }?>"  id='change'  alt='banner' />
            <?php if($barber['id']>0){?>
            <div style='text-align:center;width:13rem;height: 13rem;right:2%;margin-top:-9rem;position: absolute;z-index:100;background-color:white;border-radius:50%;'>
                <div style='height:12rem;width:12rem;margin:0.5rem auto'>
                <img src="<?php if(strlen($barber['photo'])>0){echo $barber['photo'];}else{echo '/public/images/tou.png';}?>" id='change'  style="width:100%;height: 100%;border-radius:50%;overflow:hidden;">
                </div>
                <div style='height:1rem'></div>
                <font style="font-size:1.5rem;color:black"><b><?php echo $barber['level'].' : '.$barber['name'];?></b></font>
            </div>
            <?php }?>
        </div>
 

<div class="container"  >
    <div id='content' >
        <?php  foreach($evaluates as $k=>$v){ ?>
                <div class='thumbnail' style="float:left;">
                    <div style="height:9rem;width:9rem;overflow: hidden;">
                        <img class='_img' src="<?php  echo 'http://'.IMAGE_DOMAIN_.$v['item']['images'][0]['image'] ;?>" style='width:100%;height:100%'/>
                    </div>
                </div>
                <div style='margin-left:12rem;font-size:1.5rem' >
                    <div  style='margin-top:1rem;' ><?php echo $v['item']['name'];?></div>
                    <div style='color:red;'><i><font >￥<?php echo $v['item']['price']/100; ?></font></i>
                         <span style='float:right;overflow:hidden;color:red'>
                          已完成
                        </span>
                    </div>
                    <?php if($v['item']['items']){ foreach($v['item']['items'] as $kk=>$vv){ ?>
                    <div>
                        <span> <?php echo $vv['name']; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;X<?php echo $vv['number']; ?></span>
                    </div>
                    <?php } } ?>

                    <input type='hidden' id='store_id' value="<?php echo $v['item']['store_id']; ?>" >
                </div>
                <div style='clear:both;'></div>
                
                <div >
                    <div style='padding:0.5rem 0 0 0;' >
                        我的评价：<?php  echo $v['relpy']; ?>
                    </div>
                    <div style='padding:0.5rem 0 0 3%;'>
                        <span style='color:#FF8C00;' >商家回复</span>：<?php echo $v['content']; ?>
                    </div>
                    <div class='_line'></div>
                </div> 
                
                <?php } ?>


<script type="text/javascript">
$(document).ready(function(){
    //追加
    var number =12;
    function loaddata(){
        if (number == -1) {
            return;
        }
        totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());

        if ($(document).height() <= totalheight)
        {
            var store_id = $("#store_id").val();
            $.ajax({url: "/user/evaluate/unread?start="+number+ "&store_id="+store_id, async: true, 
                success: function (msg) {

                    if (msg == 'false') {
                        number = -1;
                        return;
                    }
                    var html = "";
                    msg = eval('(' + msg + ')');
                    $.each(msg, function (i, v) {
                        var image_domain = "<?php echo IMAGE_DOMAIN_;?>";
                        var img = '<?php echo "http://'+image_domain+v.item.images[0].image+'";?>';
                        html += "<div class='thumbnail' style='float:left;'>";
                        html += " <div style='height:9rem;width:9rem;overflow: hidden;'>";
                        html += "<img class='_img' src="+img+" style='width:100%;height:100%;' />";
                        html += "</div></div>";
                        html += "<div style='margin-left:12rem;font-size:1.5rem' >";
                        html += "<div  style='margin-top:1rem;' >"+v.item.name+"</div>";
                        html += "<div style='color:red;margin-top:1rem;' ><i><font >￥"+Number((v.item.price)/100)+"</font></i>";
                        html += "<span style='float:right;overflow:hidden;color:red'>已完成</span>";
                        html += "</div>";
                        if(v.item.items){
                            $.each(v.item.items, function (h, t) {
                                html += "<div><span>"+t.name+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;X"+t.number+"</div></span>";
                                
                            }); 
                        }
                        html += "</div>";
                        html += "<div style='clear:both;'></div>";
                        html += "<div style='padding:1rem 0 0 0;'>我的评价：";
                        html += v.relpy;
                        html += "</div>";
                        html += "<div style='padding:1rem 0 0 3%;'><span style='color:#FF8C00;' >商家回复</span>：";
                        html += v.content;
                        html += "</div>";
                        html += "<div class='_line'></div>";
                        number += 1;
                    });
                    $('#content').append(html);
                }
            });
        }
    } 
    $(window).scroll(function () {
        loaddata();
    });

})


</script>


</div>
<div class="_line"></div>
<div class='box navbar-fixed-bottom' style='background-color:#dddddd;'>
    <button class="btn btn-primary btn-lg"  type="button" id='shop' style="width:17%;background-color:#dddddd;border-color:#dddddd;color:black;font-size:10px"><img src="/public/images/ShopList.png" style='width:30px' ><br>
        <span style='margin-left:-0.8rem' >商品中心</span></button>
    <button class="btn btn-primary btn-lg"  type="button" id='action' style="width:17%;background-color:#dddddd;border-color:#dddddd;color:black;font-size:10px"><img src="/public/images/ActivityCenter.png" style='width:30px' ><br><span style='margin-left:-0.8rem'>活动中心</span></button>
    <button class="btn btn-primary btn-lg"  type="button" id='kaka' style="width:27%;background-color:#dddddd;border-color:#dddddd;color:black;"><img src="/public/images/kaka2.png" class="img-circle" style='height:60px;width:60px;margin-left:-3rem;position:absolute;top:0.2rem;' ></button>
    <button class="btn btn-primary btn-lg"  type="button" id='cart' style="width:17%;background-color:#dddddd;border-color:#dddddd;color:black;font-size:10px"><img src="/public/images/ShopCart.png" style='width:30px' ><br>购物车</button>
     <button class="btn btn-primary btn-lg"  type="button" id='user' style="width:17%;background-color:#dddddd;border-color:#dddddd;color:black;font-size:10px"><img src="/public/images/UserCenter.png" style='width:32px' ><br><span style='margin-left:-0.8rem'>个人中心</span></button>
</div>
<div id='showCode' style="text-align:center;width:100%;height:100%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#8E8E8E',endColorstr='##8E8E8E');
    background-color:rgba(0, 0,0, 0.5);position:fixed; _position:absolute; top:0;left:0; z-index:5000;display:none "> 
    <div class="settle_div" >
        <div style='font-size:2rem'>门店信息</div>
        <div style='padding:4rem;'>
            <img src="<?php echo $logo ?>" style="width:80%" >
            <div style='font-size:1.5rem;' > <?php echo $store['name'] ?> </div>
            <div style='font-size:1.5rem;' >联系人： <?php echo $store['person_charge'] ?> </div>
            <div style='font-size:1.5rem;' >联系电话： <?php echo $store['tel'] ?> </div>
            <div style='font-size:1.5rem;' >地址： <?php echo $store['address'] ?> </div>  
        </div>
        <button class="btn btn-primary btn-lg"  type="button" id='hide' style="width:25%;background-color:#dddddd;border-color:#dddddd;color:black;">确定</button>
        <div class='_line'></div>
</div>

</div>
<div class='_line'></div>
</div>
    </body>
</html>
<script type="text/javascript">
    $(document).ready(function(){
        $('#shop').click(function(){
            window.location.href= '<?php echo shop_buildUrl("/user/shop"); ?>';
        });
        $('#action').click(function(){
            window.location.href= '<?php echo shop_buildUrl("/user/action"); ?>';
        });
        $('#kaka').click(function(){
            //门店信息
            $('#showCode').show();
        });
        $('#cart').click(function(){
            window.location.href= '<?php echo shop_buildUrl("/user/shop/shoppingcart"); ?>';
        });
        $('#user').click(function(){
            window.location.href= '<?php echo shop_buildUrl("/user/shop/personal"); ?>';
        });
        $('#hide').click(function(){
            //门店信息
            $('#showCode').hide();
        }); 
    })
</script>